package org.learn.file;

import java.io.BufferedReader;
import java.io.FileReader;

public class BufferedReader_ {
    public static void main(String[] args) throws Exception{

        String filePath = "d:\\a.txt";
        //创建BufferedReader对象
        BufferedReader bufferedReader = new BufferedReader(new FileReader(filePath));
            //读取
            String line;//按行读取
        while( (line = bufferedReader.readLine()) != null){
            System.out.println(line);
        }
            //关闭流，只需关闭外层流即可；底层会自动关闭节点流；
        bufferedReader.close();



    }
}
